package org.melanesia.converters.jdbc;

import java.sql.CallableStatement;
import java.sql.Types;

import org.melanesia.converters.JavaToJdbcConverter;
import org.melanesia.converters.exceptions.ConversionException;
import org.melanesia.converters.java.DateToDateConverter;

/**
 * Converts date types into {@link java.sql.Timestamp} for passing inside the JDBC.
 *
 * @author marcin.kielar
 */
public class DateToJdbcConverter extends DateToDateConverter implements JavaToJdbcConverter {

    /**
     * Constructs a {@code DateToJdbcConverter}.
     */
	public DateToJdbcConverter() {
		super(java.sql.Timestamp.class);
	}

	@Override
	public final int getJdbcType() {
		return Types.TIMESTAMP;
	}

	@Override
	public final Object convert(final Object value, final CallableStatement stmt, final String parameterName) throws ConversionException {
		return super.convert(value);
	}
}
